//
// Created by Xu Xiao on 2022/9/11.
//

#ifndef ALGORITHM_22_1_SLN_N_Q2560_H
#define ALGORITHM_22_1_SLN_N_Q2560_H

#include <iostream>
#include <cstring>
#include <climits>
#include <unordered_map>

using namespace std;

class Sln_N_Q2560 {
private:
    int table_x, table_y, card_x, card_y, paper_x, paper_y;

    int cut(int &a, int &b, int &c, int &d, int &e, int &f) {
        if (a * c > e || b * d > f) return INT_MAX;
        else {
            return a * b - 1 + (a * c < e ? 1 : 0) + (b * d < f ? 1 : 0);
        }
    }

    void solve() {
        int m = INT_MAX;
        m = min(m, cut(table_x, table_y, card_x, card_y, paper_x, paper_y));
        m = min(m, cut(table_y, table_x, card_x, card_y, paper_x, paper_y));
        m = min(m, cut(table_x, table_y, card_y, card_x, paper_x, paper_y));
        m = min(m, cut(table_y, table_x, card_y, card_x, paper_x, paper_y));
        if (m == INT_MAX) {
            cout << "The paper is too small." << endl;
        } else {
            cout << "The minimum number of cuts is " << m << "." << endl;
        }
    }

public:
    Sln_N_Q2560() {
        while (cin >> table_x >> table_y >> card_x >> card_y >> paper_x >> paper_y) {
            if (table_x + table_y + card_x + card_y + paper_x + paper_y == 0) break;
            solve();
        }
    }
};


#endif //ALGORITHM_22_1_SLN_N_Q2560_H
